const util = require('../../utils/util.js')
const app = getApp();
Component({
  properties: {
    itemData: null
  },
  methods: {
    gotoPage(e) {  // 课程列表跳转函数
      if (app.globalData.stopMoreClick) return
      app.globalData.stopMoreClick = true
      const { courseid, formalclassid, classid, noticeId, packId, coursename, status, begintime, endtime, show, selTimeBegin, selTimeEnd, formalClassName } = this.properties.itemData
      let attendCourse = {
        formalClassId: formalclassid,
        formalClassName: formalClassName,
        classBegin: begintime,
        classEnd: endtime,
        courseName: coursename
      }

      wx.setStorageSync('attendCourse', attendCourse)

      wx.navigateTo({
        url: `/pages/attendance/attendanceDetail/attendanceDetail?attendanceSign=1`
      })

      // switch (status) {
      //   case '4': //已排班
      //     wx.navigateTo({
      //       url: `/pages/attendance/attendanceDetail/attendanceDetail?attendanceSign=1`
      //     })
      //     break;
      //   case '5': //待开班
      //     wx.navigateTo({
      //       url: `/pages/attendance/attendanceDetail/attendanceDetail?`
      //     })
      //     break;
      //   case '6': //已开班
      //     wx.navigateTo({
      //       url: `/pages/attendance/attendanceDetail/attendanceDetail?`
      //     })
      //     break;
      //   case '7': //已结课
      //     wx.navigateTo({
      //       url: `/pages/attendance/attendanceDetail/attendanceDetail?`
      //     })
      //     break;
      // }
    }
  }
})